﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using WCrawlerLib;

namespace WCrawler
{
    public partial class frmForumTemplates : System.Web.UI.Page
    {
        public void ucForumControlSelectedIndexChanged(object sender, EventArgs e)
        {
            Session["ucForum_GridViewForums"] = (GridView)ucForumControl.FindControl("gridViewForums");
            Session["ucForum_SelectedValue"] = ucForumControl.SelectedValue;
            GridView gridViewForumTemplates = (GridView)ucForumTemplates.FindControl("gridViewForumTemplates");
            gridViewForumTemplates.DataBind();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            //enable javascript
            //this.Page.Header.DataBind();

            if (!Page.IsPostBack)
            {
                Panel pnlCommand = (Panel)ucForumControl.FindControl("pnlCommand");
                pnlCommand.Visible = false;
                GridView gridViewForums = (GridView)ucForumControl.FindControl("gridViewForums");
                gridViewForums.SelectedIndex = 0;
                CommandField cmdField = (CommandField)gridViewForums.Columns[0];
                cmdField.ShowEditButton = false;
                cmdField.ShowDeleteButton = false;
            }
        }
    }
}